#ifndef _MyTimer_H
#define _MyTimer_H


//定时器(定时器模式)测试程序   V1.0           修改日期：2025/6/7
//实现功能：LED灯以1S为周期闪烁
//By:TAO XIN YU (陶鑫宇)


#include "gd32e230.h"                   // Device header
#include "LED.h"

//*********************************************************//
//定时器通道   GPIOA区
#define TIMER0_BRKIN_PIN			 GPIO_PIN_6
#define TIMER0_CH0_ON_PIN			 GPIO_PIN_7
#define TIMER0_CH0_PIN			 	 GPIO_PIN_8
#define TIMER0_CH1_PIN			 	 GPIO_PIN_9
#define TIMER0_CH2_PIN			 	 GPIO_PIN_10
#define TIMER0_CH3_PIN			 	 GPIO_PIN_11
#define TIMER0_ETI_PIN			 	 GPIO_PIN_12

#define TIMER2_CH0_PIN				 GPIO_PIN_6
#define TIMER2_CH1_PIN				 GPIO_PIN_7

#define TIMER13_CH0_PIN				 GPIO_PIN_4
//#define TIMER13_CH0_PIN				 GPIO_PIN_6

#define TIMER14_CH0_ON_PIN     GPIO_PIN_1
#define TIMER14_CH0_PIN				 GPIO_PIN_2
#define TIMER14_CH1_PIN				 GPIO_PIN_3
#define TIMER14_BRKIN_PIN			 GPIO_PIN_9

#define TIMER15_CH0_PIN				 GPIO_PIN_6

#define TIMER16_CH0_PIN				 GPIO_PIN_7
#define TIMER16_BRKIN_PIN      GPIO_PIN_10

//*********************************************************//
//定时器通道   GPIOB区
#define TIMER0_CH1_ON_PIN			 GPIO_PIN_0
#define TIMER0_CH2_ON_PIN			 GPIO_PIN_1

//#define TIMER2_CH0_PIN			 	 GPIO_PIN_4
//#define TIMER2_CH1_PIN				 GPIO_PIN_5
#define TIMER2_CH2_PIN			 	 GPIO_PIN_0
#define TIMER2_CH3_PIN				 GPIO_PIN_1

//#define TIMER13_CH0_PIN			 	 GPIO_PIN_1

#define TIMER15_BRKIN_PIN			 GPIO_PIN_5
#define TIMER15_CH0_ON_PIN			 GPIO_PIN_6

//#define TIMER16_BRKIN_PIN			 GPIO_PIN_4
#define TIMER16_CH0_ON_PIN			 GPIO_PIN_7



//初始化TIMER2
//参数： prescaler：			预分频器值
//参数： period：				重装载计数器值
//无返回值
void MyTimer2_init(unsigned int prescaler,unsigned int period);






#endif
